#!/bin/bash
ROOT=$1
for conf in $ROOT/etc/systemd/network/*.network; do
  grep "MulticastDNS=resolve" $conf >/dev/null
  if [ "$?" != 0 ]; then 
    cp $conf $conf.bak
    sed -i '/^\[Network\].*/a MulticastDNS=resolve' $conf
  fi
done

